package edu.umn.msse.farside.FourH.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.support.SessionStatus;

import javax.servlet.http.HttpSession;

/**
 * User: Farside
 * Date: Mar 21, 2009
 * To change this template use File | Settings | File Templates.
 */
@Controller
@RequestMapping("/logout")
public class LogoutController
{
    @RequestMapping(method = {RequestMethod.GET, RequestMethod.POST})
    public String loginVolunteerForm(HttpSession session, SessionStatus sessionStatus)
    {
        session.removeAttribute("volunteer");
        sessionStatus.setComplete(); // Clears @SessionAttributes
        return "redirect:login";
    }
}
